import React from 'react'
export default class Tap extends React.Component{
    constructor() {
        super()
    }
    componentDidMount () {
    }
    // shouldComponentUpdate (nextProps) {
	//     return (nextProps.screenIndex === this.props.localScreenIndex) || (this.props.areaType !== nextProps.areaType)
    // }
    render() {
        let {localScreenIndex, areaType, screenIndex, mediaType, mediaURL } =this.props
        return <div className={areaType + " screenArea"}>
          {(mediaType === 'website' ) && <iframe src={mediaURL} ></iframe>}
          {(mediaType === 'video' ) && <video autoPlay="autoplay" loop src={mediaURL} >你的浏览器不支持html5视频播放</video>}
          { (mediaType === 'image' ) && <div className="img-bg" style={{'backgroundImage':  'url(' + mediaURL + ')'}}> </div>  }
          {((localScreenIndex !== screenIndex) && <div className="bg"><i className="fa fa-star-o" aria-hidden="true"></i></div>) }
          <span className="tip">{this.props.title}</span>
        </div>
    }
}